package com.ruoyi.back.controller.v3

import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.ruoyi.ability.Ability
import com.ruoyi.app.common.Data
import com.ruoyi.app.common.Ok
import com.ruoyi.back.domain.v3.StyleSetting
import com.ruoyi.back.domain.v3.dto.StyleSearchDto
import com.ruoyi.back.domain.v3.dto.UserRecordSearchDto
import com.ruoyi.back.domain.v3.vo.*
import com.ruoyi.back.service.UserRecordService
import com.ruoyi.back.service.v3.MyRecordService
import com.ruoyi.back.service.v3.StyleSettingService
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.*

@RestController
@RequestMapping("/system/userRecord")
@Api(tags = ["风格管理"])
class StyleSettingController {

    @Autowired
    private lateinit var styleSettingService: StyleSettingService

    @Autowired
    private lateinit var ability: Ability

    @ApiOperation("文生图")
    @GetMapping("text2PicStyleList")
    fun text2PicStyleList(styleSearchDto: StyleSearchDto): Data<List<Text2PicStyleVo>> = styleSettingService.text2PicStyleList(styleSearchDto)

    @ApiOperation("图生图")
    @GetMapping("pic2PicStyleList")
    fun pic2PicStyleList(styleSearchDto: StyleSearchDto): Data<List<Pic2PicStyleVo>> = styleSettingService.pic2PicStyleList(styleSearchDto)

    @ApiOperation("卡通")
    @GetMapping("cartoonStyleList")
    fun cartoonStyleList(styleSearchDto: StyleSearchDto): Data<List<CartoonStyleVo>> = styleSettingService.cartoonStyleList(styleSearchDto)

    @ApiOperation("更新风格信息")
    @GetMapping("updateStyle")
    fun updateStyle(styleSetting: StyleSetting): Data<Boolean> = styleSettingService.updateStyle(styleSetting)

    @ApiOperation("初始化不用对接")
    @GetMapping("style")
    fun styleInit(): Data<Boolean> {
        ability.initStyle()
        return Ok("成功", true)
    }
}